package com.wondertek.service.entity.sys;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wondertek.common.base.BaseEntity;
import com.wondertek.common.i18n.AutoLang;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author xqs
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_log")
public class SysLogPo extends BaseEntity {

    /**
     * 日志类别
     */
    @Schema(name = "category",description = "日志类别")
    private String category;

    /**
     * 执行参数
     */
    @Schema(name = "params",description = "执行参数")
    private String params;

    /**
     * 操作类型
     */
    @Schema(name = "handleType",description = "操作类型")
    @AutoLang(field = "handleType")
    private String handleType;

    /**
     * 操作备注
     */
    @Schema(name = "handleNote",description = "操作备注")
    private String handleNote;

    /**
     * 操作时间
     */
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(name = "handleTime",description = "操作时间")
    private Date handleTime;

    /**
     * 耗时
     */
    @Schema(name = "costTime",description = "耗时")
    private long costTime;

    /**
     * 操作ip
     */
    @Schema(name = "handleIp",description = "操作ip")
    private String handleIp;

    /**
     * 是否成功
     */
    @Schema(name = "success",description = "是否成功")
    private Boolean success;

    /**
     * 状态码
     */
    @Schema(name = "code",description = "状态码")
    private Integer code;

    /**
     * 处理信息
     */
    @Schema(name = "message",description = "处理信息")
    private String message;


    /**
     * 用户id
     */
    @Schema(name = "userId",description = "用户id")
    private String userId;

    /**
     * 用户名
     */
    @Schema(name = "username",description = "用户名")
    private String username;

    /**
     * 角色名
     */
    @Schema(name = "roleName",description = "角色名")
    private String roleName;

    /**
     * 站点名称
     */
    @Schema(name = "siteName",description = "站点名称")
    private String siteName;

    /**
     * 站点id
     */
    @Schema(name = "siteId",description = "站点id")
    private String siteId;

    /**
     * 地址
     */
    @Schema(name = "address",description = "地址")
    private String address;

    /**
     * 设备id
     */
    @Schema(name = "deviceId",description = "设备id")
    private String deviceId;

    /*
     * 配件sn
     * */
    private String accessoryId;
}
